﻿@model IEnumerable<RedSand.Site.Models.SpecificationInfo>
<script type="text/javascript">
    function update_properties_success() {
        $('#save-product-info').click();
    }
    function update_properties_begin() {
        $('#loading-panel').show();
    }
</script>
<div id="product-properties">
    @if (Model != null)
    {
        using (Ajax.BeginForm("Properties", new AjaxOptions { OnBegin="update_properties_begin" , OnFailure = "ajax_failure", OnSuccess = "update_properties_success" }))
        {
        <table class="table-list">
            <thead>
                <tr>
                    <th class="width-120">
                        Name
                    </th>
                    <th>
                        Value
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            <input type="hidden" name="PropertyID" value="@item.PropertyID" />
                            @item.PropertyName
                        </td>
                        <td>
                            <textarea style="height:20px; width:600px" name="Value">@item.Value</textarea>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div class="dialog-footer">
            <input type="submit" value="Save" id="save-product-properties" />
            <input type="button" value="Cancel" onclick="closeDialog('.dialog')" />
        </div>
        }
    }
</div>
